﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using SES.CMS.BL;
using SES.CMS.DO;

namespace SES.CMS.Module
{
    public partial class ucProductSameCollection : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!string.IsNullOrEmpty(Request.QueryString["ID"]))
            {
                long ID = int.Parse(Request.QueryString["ID"]);
                DataTable dtSanPham = new cmsSanPhamBL().SelectCollectionbySanPhamID(ID);
                if(dtSanPham.Rows.Count>0)
                {
                    rptproDataSource(ID);
                }
            }

        }

        protected void rptproDataSource(long sanPhamID)
        {
            //CollectionPager1.MaxPages = 10000;

            //CollectionPager1.PageSize = 1; // số items hiển thị trên một trang

            //CollectionPager1.DataSource = new cmsSanPhamBL().SelectCollectionbySanPhamID(sanPhamID).DefaultView; ;

            //CollectionPager1.BindToControl = rptpro;

            //rptpro.DataSource = CollectionPager1.DataSourcePaged;
            rptpro.DataSource = new cmsSanPhamBL().SelectCollectionbySanPhamID(sanPhamID);
            rptpro.DataBind();

        }
        protected string FriendlyUrl(string strTitle)
        {
            return Ultility.Change_AV(strTitle);
        }
    }
}